﻿@namespace Project.Web.Shared.Components
@inherits ConditionBase
<MGridContent ColSpan="@ColSpan" RowSpan="@RowSpan">
    <span class="condition" style="@Style;min-width:@(ColumnWidthStyle);max-width:@(ColumnWidthStyle);">
        <span class="label" style="min-width:@(LabelWidthStyle);max-width:@(LabelWidthStyle);">
            @Label
        </span>
        <span class="content" style="min-width:@(ContentWidthStyle);max-width:@(ContentWidthStyle);">
            @if (Field != null && ChildContent == null)
            {
                if (Field.DataType == typeof(DateTime) || Field.DataType == typeof(DateTime?))
                {
                    @(UI.BuildDatePicker(this).Bind(() => dateValue, NotifyChanged).Render())
                }
                else if (Field?.EnumValues != null || (Field?.IsEnum ?? false))
                {
                    @(UI.BuildDictionarySelect(this, Field.EnumValues!).Bind(() => stringValue, NotifyChanged).Render())
                }
                else
                {
                    @UI.BuildInput(this).Bind(() => stringValue, NotifyChanged).Render()
                }
            }
            else
            {
                @ChildContent
            }
        </span>
    </span>
</MGridContent>
